/**
 * Licensee: 
 * License Type: Evaluation
 */
package ormsamples;

import org.orm.*;
public class CreatePrueba1Data {
	public void createTestData() throws PersistentException {
		PersistentTransaction t = orm.Prueba1PersistentManager.instance().getSession().beginTransaction();
		try {
			orm.DAOFactory lDAOFactory = orm.DAOFactory.getDAOFactory();
			orm.dao.Com_logDAO lormCom_logDAO = lDAOFactory.getCom_logDAO();
			orm.Com_log lormCom_log = lormCom_logDAO.createCom_log();
			// TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : log_resultado, log_hora, log_tiempo
			lormCom_logDAO.save(lormCom_log);
			orm.dao.Com_precioDAO lormCom_precioDAO = lDAOFactory.getCom_precioDAO();
			orm.Com_precio lormCom_precio = lormCom_precioDAO.createCom_precio();
			// TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : pre_precioDia
			lormCom_precioDAO.save(lormCom_precio);
			t.commit();
		}
		catch (Exception e) {
			t.rollback();
		}
		
	}
	
	public static void main(String[] args) {
		try {
			CreatePrueba1Data createPrueba1Data = new CreatePrueba1Data();
			try {
				createPrueba1Data.createTestData();
			}
			finally {
				orm.Prueba1PersistentManager.instance().disposePersistentManager();
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
}
